package pdfsetter.core.pages;

/**
 * This class holds information about page - its size (width and height). We can construct PageInfo object from some predefined types, which are represented by
 * {@link PageType} class. We measure size in millimeters.
 * 
 * @author Andrzej Dorobisz
 */

public class PageInfo {
    private final double width;
    private final double height;

    public PageInfo(double width, double height) {
        this.width = width;
        this.height = height;
    }

    public PageInfo(PageType pageType) {
        this.width = pageType.getWidth();
        this.height = pageType.getHeight();
    }

    public double getWidth() {
        return width;
    }

    public double getHeight() {
        return height;
    }

    public PageInfo rotate() {
        return new PageInfo(height, width);
    }
}
